import request from '@/utils/request'

// 查询文件上传列表
export function listFileInfo(query) {
  return request({
    url: '/system/fileinfo/list',
    method: 'get',
    params: query
  })
}

// 查询文件上传详细
export function getFileInfo(engFileId) {
  return request({
    url: '/system/fileinfo/' + engFileId,
    method: 'get'
  })
}

export function getFileInfoById(data){
  return request({
    url: '/system/fileinfo/getFileInfoById',
    method: 'post',
    data: data
  })
}



export function getPdf(data) {
  return request({
    url: '/system/fileinfo/getPdf',
    method: 'post',
    data: data,
    responseType:'arraybuffer'
  })
}

export function getType(data) {
  return request({
    url: '/system/fileinfo/getType',
    method: 'post',
    data: data,
  })
}

// 新增文件上传
export function addFileInfo(data) {
  return request({
    url: '/system/fileinfo',
    method: 'post',
    data: data
  })
}

//获取文件注释信息
export function getFileCommentInfo() {
  return request({
    url: '/system/fileinfo/getFileCommentInfo',
    method: 'post'
  })
}

// 修改文件上传
export function updateFileInfo(data) {
  return request({
    url: '/system/fileinfo',
    method: 'put',
    data: data
  })
}

// 删除文件上传
export function delFileInfo(engFileId) {
  return request({
    url: '/system/fileinfo/' + engFileId,
    method: 'delete'
  })
}

export function removeFileInfoById(data) {
  return request({
    url: '/system/fileinfo/removeFileInfoById',
    method: 'post',
    data: data
  })
}

export function downloadMore(engFileId) {
  return request({
    url: '/system/fileinfo/downloadMore/' + engFileId,
    method: 'get',
    responseType:'arraybuffer'
  })
}
